<?php
namespace soa\mp\cloudPrint\v1;

use soa\client;

class agentUser  extends client
{
	/**
	 * 服务地址
	 * @var string
	 */
	public $service_url = 'http://mp.kuaidihelp.com/';
	/**
	 * 服务名称
	 * @var string
	 */
	protected $service_name = 'kuaidihelp_mp';

	public function insert($uid, $platform, $agent_guid, $extra_info){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/insert", compact('uid', 'platform', 'agent_guid', 'extra_info'));
	}

	public function getDefaultAgent($uid, $platform){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/getDefaultAgent", compact('uid', 'platform'));
	}

	public function getByUser($uid, $platform, $extra_info = [],$limit = [], $order_by = "update_time DESC"){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/getByUser", compact('uid', 'platform', 'extra_info', 'limit', 'order_by'));
	}

	public function getByAgent($agent_guid, $extra_info = [],$limit = [], $order_by = "update_time DESC"){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/getByAgent", compact('agent_guid', 'extra_info', 'limit', 'order_by'));
	}

	public function del($uid, $platform, $agent_guid){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/del", compact('uid', 'platform', 'agent_guid'));
	}

	public function setCanUse($uid, $platform, $agent_guid, $can_use){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/setCanUse", compact('uid', 'platform', 'agent_guid', 'can_use'));
	}

	public function setCanUseByAgent($agent_guid, $can_use){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/setCanUseByAgent", compact('agent_guid', 'can_use'));
	}

	public function setDefault($uid, $platform, $agent_guid){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/setDefault", compact('uid', 'platform', 'agent_guid'));
	}

	public function setUNote($uid, $platform, $agent_guid,$u_note){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/setUNote", compact('uid', 'platform', 'agent_guid','u_note'));
	}

	//微商添加用户
	public function vAdd($text,$uid,$platform,$extra_info = []){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/vAdd",compact('text','uid','platform','extra_info'));
	}

	//获取用户agent列表，附带agent信息
	public function vGetByUser($uid,$platform,$extra_info = [],$limit = [],$order_by = "update_time DESC"){
		return $this->post("api/cloudPrint/cloudPrint/v1/agentUser/vGetByUser",compact('uid', 'platform', 'extra_info', 'limit', 'order_by'));
	}
}